import { axios } from '@/utils/request'

export const signTypeList = [
    {
        label: '个体工商户',
        value: 'INDIVIDUAL'
    },
    {
        label: '企业',
        value: 'ENTERPRISE'
    },
    {
        label: '事业单位',
        value: 'INSTITUTION'
    },
    {
        label: '社会团体',
        value: 'COMMUNITY'
    },
]

export const legalLicenceTypeList = [
    { label: '身份证', value: 'ID_CARD' },
    { label: '护照', value: 'PASSPORT' },
    { label: '港澳居民往来内地通行证', value: 'HM_VISITORPASS' },
    { label: '台胞证', value: 'TAIWAN' },
    { label: '士兵证', value: 'SOLDIER' },
    { label: '军官证', value: 'OFFICERS' },
]

const api = {
    selectMerchantStatus: '/admin/registerSaasMerchant/selectMerchantStatus',
    ybBankList: '/admin/ybBank/list',
    ybAddress: '/admin/ybAddress/',

    merchantQualUpload: '/admin/registerSaasMerchant/merchantQualUpload',
    save: '/admin/registerSaasMerchant/save',
    saveAndSubmit: '/admin/registerSaasMerchant/saveAndSubmit',
    selectInfo: '/admin/registerSaasMerchant/selectInfo',
    repeat: '/admin/registerSaasMerchant/repeat',
    authTemplate: '/admin/registerSaasMerchant/getMaterial/authTemplate',
    wechatAuthCode: '/admin/registerSaasMerchant/getMaterial/wechatAuth',

    dataReport: '/admin/settleInfo/report',
    ticketDataReport: '/admin/settleInfo/activityTicket/report',
    incomeList: '/admin/settleInfo/incomeList',
    ticketIncomeList: '/admin/settleInfo/activityTicket/incomeList',
    settList: '/admin/settleInfo/settList',
    ticketSettList: '/admin/settleInfo/activityTicket/settList',

    getMerchantAccount: '/admin/settleInfo/merchantAccount',
    resourcesDataReport: '/mall/mp/finance-manage/resource/report',
    resourcesIncomeList: '/mall/mp/finance-manage/resource/unsettledOrderList',
    resourcesSettList: '/mall/mp/finance-manage/resource/settledOrderList'
}

export default api

/**
  * 查询易宝账户状态
  */
export function SelectMerchantStatus(params) {
    return axios({
        url: api.selectMerchantStatus,
        method: 'get',
        params
    })
}

/**
  * 易宝银行编码列表
  */
export function YbBankList(params) {
    return axios({
        url: api.ybBankList,
        method: 'get',
        params
    })
}

/**
  * 易宝地址省市区
  */
export function YbAddress(params) {
    return axios({
        url: api.ybAddress + params,
        method: 'get',
    })
}

/**
  * 保存草稿
  */
export function Save(data) {
    return axios({
        url: api.save,
        method: 'post',
        data
    })
}

/**
  * 保存并提交
  */
export function SaveAndSubmit(data) {
    return axios({
        url: api.saveAndSubmit,
        method: 'post',
        data
    })
}

/**
  * 查询入网资料
  */
export function SelectInfo(params) {
    return axios({
        url: api.selectInfo,
        method: 'get',
        params
    })
}

/**
  * 获取短信、邮箱验证信息
  */
export function Repeat(params) {
    return axios({
        url: api.repeat,
        method: 'get',
        params
    })
}

/**
  * 获取授权书模板
  */
export function AuthTemplate() {
    return axios({
        url: api.authTemplate,
        method: 'get',
    })
}

/**
  * 获取微信授权二维码
  */
export function WechatAuthCode() {
    return axios({
        url: api.wechatAuthCode,
        method: 'get',
    })
}

/**
  * 活动售票订单-数据汇总
  */
export function ticketDataReport(datetype) {
    return axios({
        url: api.ticketDataReport + `?datetype=${datetype}`,
        method: 'get',
    })
}

export function DataReport(datetype) {
    return axios({
        url: api.dataReport + `?datetype=${datetype}`,
        method: 'get',
    })
}


/**
  * 资源平台数据汇总
  */
export function resourcesDataReport(datetype) {
    return axios({
        url: api.resourcesDataReport + `?datetype=${datetype}`,
        method: 'get',
    })
}
/**
  * 付款预估收益明细
  */
export function IncomeList(params) {
    return axios({
        url: api.incomeList,
        method: 'get',
        params
    })
}

export function ticketIncomeList(params) {
    return axios({
        url: api.ticketIncomeList,
        method: 'get',
        params
    })
}

/**
 * 资源平台订单结算-待结算收益明细
 * @param {*} params 
 * @returns 
 */
export function resourcesIncomeList(params) {
    return axios({
        url: api.resourcesIncomeList,
        method: 'get',
        params
    })
}

/**
  * 结算收益明细
  */
export function SettList(params) {
    return axios({
        url: api.settList,
        method: 'get',
        params
    })
}

/**
 * 活动票结算收益明细
 * @param {*} params 
 * @returns 
 */
export function ticketSettList(params) {
    return axios({
        url: api.ticketSettList,
        method: 'get',
        params
    })
}

/**
 * 资源平台订单结算-结算收益明细
 * @param {*} params 
 * @returns 
 */
export function resourcesSettList(params) {
    return axios({
        url: api.resourcesSettList,
        method: 'get',
        params
    })
}

/**
 * 获取商户账户中心信息
 * @returns 
 */
export function getMerchantAccount() {
    return axios({
        url: api.getMerchantAccount,
        method: 'get',
    })
}